import request from '@/utils/request'

/**
 * 考试记录API
 */
export const recordApi = {
  /**
   * 分页查询考试记录
   */
  listRecords(page = 1, size = 10, studentId = null, passed = null) {
    const params = { page, size }
    if (studentId) params.studentId = studentId
    if (passed !== null) params.passed = passed
    return request({
      url: '/api/admin/records',
      method: 'get',
      params
    })
  },

  /**
   * 获取考试统计信息
   */
  getStatistics() {
    return request({
      url: '/api/admin/records/statistics',
      method: 'get'
    })
  }
}

